﻿using System;

namespace SmartCA.Model.Membership
{
    public class Application
    {
        #region Private Fields

        private string name;
        private bool enablePasswordReset;
        private bool enablePasswordRetrieval;
        private int maxInvalidPasswordAttempts;
        private int minRequiredNonAlphanumericCharacters;
        private int minRequiredPasswordLength;
        private int passwordAttemptWindow;
        private PasswordFormat passwordFormat;
        private string passwordStrengthRegularExpression;
        private bool requiresQuestionAndAnswer;
        private bool requiresUniqueEmail;
        private bool isDecryptionKeyAutogenerated;
        private bool isHashAlgorithmFromMembershipConfig;
        private string hashAlgorithmType;
        private int maxPasswordSize;
        private int maxPasswordAnswerSize;
        private int maxUsernameSize;
        private int maxPasswordQuestionSize;

        #endregion

        #region Constructors

        public Application(string name, bool enablePasswordReset,
            bool enablePasswordRetrieval, int maxInvalidPasswordAttempts,
            int minRequiredNonAlphanumericCharacters, int minRequiredPasswordLength,
            int passwordAttemptWindow, PasswordFormat passwordFormat,
            string passwordStrengthRegularExpression, bool requiresQuestionAndAnswer,
            bool requiresUniqueEmail, bool isDecryptionKeyAutogenerated,
            bool isHashAlgorithmFromMembershipConfig, string hashAlgorithmType,
            int maxPasswordSize, int maxPasswordAnswerSize, int maxUsernameSize,
            int maxPasswordQuestionSize)
        {
            this.name = name;
            this.enablePasswordReset = enablePasswordReset;
            this.enablePasswordRetrieval = enablePasswordRetrieval;
            this.maxInvalidPasswordAttempts = maxInvalidPasswordAttempts;
            this.minRequiredNonAlphanumericCharacters = minRequiredNonAlphanumericCharacters;
            this.minRequiredPasswordLength = minRequiredPasswordLength;
            this.passwordAttemptWindow = passwordAttemptWindow;
            this.passwordFormat = passwordFormat;
            this.passwordStrengthRegularExpression = passwordStrengthRegularExpression;
            this.requiresQuestionAndAnswer = requiresQuestionAndAnswer;
            this.requiresUniqueEmail = requiresUniqueEmail;
            this.isDecryptionKeyAutogenerated = isDecryptionKeyAutogenerated;
            this.isHashAlgorithmFromMembershipConfig = isHashAlgorithmFromMembershipConfig;
            this.hashAlgorithmType = hashAlgorithmType;
            this.maxPasswordSize = maxPasswordSize;
            this.maxPasswordAnswerSize = maxPasswordAnswerSize;
            this.maxUsernameSize = maxUsernameSize;
            this.maxPasswordQuestionSize = maxPasswordQuestionSize;
        }

        #endregion

        #region Properties

        public string Name
        {
            get { return this.name; }
        }

        public bool EnablePasswordReset
        {
            get { return this.enablePasswordReset; }
        }

        public bool EnablePasswordRetrieval
        {
            get { return this.enablePasswordRetrieval; }
        }

        public int MaxInvalidPasswordAttempts
        {
            get { return this.maxInvalidPasswordAttempts; }
        }

        public int MinRequiredNonAlphanumericCharacters
        {
            get { return this.minRequiredNonAlphanumericCharacters; }
        }

        public int MinRequiredPasswordLength
        {
            get { return this.minRequiredPasswordLength; }
        }

        public int PasswordAttemptWindow
        {
            get { return this.passwordAttemptWindow; }
        }

        public PasswordFormat PasswordFormat
        {
            get { return this.passwordFormat; }
        }

        public string PasswordStrengthRegularExpression
        {
            get { return this.passwordStrengthRegularExpression; }
        }

        public bool RequiresQuestionAndAnswer
        {
            get { return this.requiresQuestionAndAnswer; }
        }

        public bool RequiresUniqueEmail
        {
            get { return this.requiresUniqueEmail; }
        }

        public bool IsDecryptionKeyAutogenerated
        {
            get { return this.isDecryptionKeyAutogenerated; }
        }

        public bool IsHashAlgorithmFromMembershipConfig
        {
            get { return this.isHashAlgorithmFromMembershipConfig; }
        }

        public string HashAlgorithmType
        {
            get { return this.hashAlgorithmType; }
        }

        public int MaxPasswordSize
        {
            get { return this.maxPasswordSize; }
        }

        public int MaxPasswordAnswerSize
        {
            get { return this.maxPasswordAnswerSize; }
        }

        public int MaxUsernameSize
        {
            get { return this.maxUsernameSize; }
        }

        public int MaxPasswordQuestionSize
        {
            get { return this.maxPasswordQuestionSize; }
        }

        #endregion
    }
}
